From a1190ad2e6a7b426fcbe8f7ea3f279ce3525ea78 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Tue, 18 Oct 2005 18:07:11 +0100 Subject: [PATCH] Protect __del__ from failure inside __init__ by setting inTransaction before trying to create a transaction instance. Signed-off-by: Ewan Mellor --- tools/python/xen/xend/xenstore/xstransact.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/python/xen/xend/xenstore/xstransact.py b/tools/python/xen/xend/xenstore/xstransact.py index d33b209e8e..ac8269f2ba 100644 --- a/tools/python/xen/xend/xenstore/xstransact.py +++ b/tools/python/xen/xend/xenstore/xstransact.py @@ -14,6 +14,9 @@ from xen.xend.xenstore.xsutil import xshandle class xstransact: def __init__(self, path): + self.in_transaction = False # Set this temporarily -- if this + # constructor fails, then we need to + # protect __del__. self.path = path.rstrip("/") self.transaction = xshandle().transaction_start() self.in_transaction = True -- 2.30.2